<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>个人空间 - 个人博客</title>
    <link rel="stylesheet" href="style.css" />
  </head>
  <body>
    <header class="navbar">
      <div class="nav-container">
        <div class="logo">我的小窝</div>
        <nav class="nav-links">
          <a href="index.html">自我介绍</a>
          <a href="articles.html">文章</a>
          <a href="movies.html">喜欢的电影</a>
          <a href="space.html" class="active">个人空间</a>
        </nav>
      </div>
    </header>

    <div class="container">
      <div class="card">
        <div class="front">
          <p>五条悟</p>
        </div>
        <div class="back">
          <div class="background"></div>
          <div class="pic"></div>
          <div class="name">
            <p>五条悟</p>
          </div>
          <div class="info">
            <p>五条悟，日本漫画《咒术回战》中的角色</p>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>
<style>
  * {
    margin: 0;
    padding: 0;
  }
  .container {
    width: 100%;
    height: 100vh;
    background-color: rgb(242, 224, 227);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .card {
    width: 300px;
    height: 400px;
    position: absolute;
    background-color: rgb(241, 241, 241);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transform-style: preserve-3d;
    transition: all 1s ease;
  }
  .front {
    width: 300px;
    height: 400px;
    position: absolute;
    border-radius: 10px;

    background-image: url(image/img1.jpg);
    background-size: 90% auto;
    background-position: center; /* 让图片在元素内居中显示 */
    background-size: cover;
    background-repeat: no-repeat; /* 禁止图片重复 */
    backface-visibility: hidden;
  }

  .back {
    width: 300px;
    height: 400px;
    position: absolute;
    border-radius: 10px;
    background-color: #fff;
    transform: rotateY(180deg); /* 初始状态背面旋转 180 度 */
    backface-visibility: hidden; /* 翻转时隐藏元素背面 */
  }

  .card:hover {
    transform: rotateY(180deg); /* 鼠标悬停时正面旋转 180 度 */
  }

  .front p {
    font-size: 60px;
    font-weight: 700;
    font-family: "Courier New", Courier, monospace;
    color: #fff;
    text-align: center;
    margin-top: 320px;
  }

  .front p::after {
    content: "";
    background-color: darkorchid;
    width: 100px;
    height: 5px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
  }

  .background {
    width: 100%;
    height: 130px;
    background-color: #cc0d26;
    border-radius: 10px 10px 0 0;
    border-bottom-color: #000;
    border-bottom-width: 5px;
    border-bottom-style: solid;
  }
  .pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-image: url(image/五条2.png);
    background-size: contain;
    background-position: center; /* 让图片在元素内居中显示 */
    border-style: solid;
    border-width: 5px;
    position: absolute;
    top: 50px;
    right: 30%;
  }
  .name p {
    text-align: center;
    font-size: 50px;
    font-weight: bold;
    font-family: "Courier New", Courier, monospace;
    margin-top: 50px;
  }

  .name p::after {
    content: "";
    background-color: rgb(204, 50, 50);
    width: 100px;
    height: 5px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
  }
  .info {
    width: 150px;
    height: 100px;
    background-color: #fff;
    border-radius: 5px;
    border-style: dashed;
    border-color: #cc0d26;
    margin: 10px 75px;
    text-align: center;
  }
  .info p {
    font-size: 20px;
    font-weight: 500;
  }
</style>
